package com.xdf.ecommerce.converter;

import com.xdf.ecommerce.constant.BrandCategory;

import javax.persistence.AttributeConverter;

/**
 * @author chanchaw
 * @create 2025-10-27 19:38
 */
public class BrandCategoryConverter implements AttributeConverter<BrandCategory,Integer> {
    @Override
    public Integer convertToDatabaseColumn(BrandCategory brandCategory) {
        return brandCategory.getId();
    }

    @Override
    public BrandCategory convertToEntityAttribute(Integer integer) {
        return BrandCategory.of(integer);
    }
}
